package com.yenlien.traceyun.business.dao;

import com.yenlien.traceyun.business.entity.Warehouse;
import com.yenlien.traceyun.webase.dao.BaseJpaDao;
import org.springframework.data.jpa.repository.Query;

import java.util.Collection;
import java.util.List;

/**
 * Created by LiuSha on 2020/7/28.
 */
public interface WarehouseDao extends BaseJpaDao<Warehouse> {
    Warehouse findById(String id);

    public List<Warehouse> findByIdIn(Collection<String> ids);

    public List<Warehouse> findByCompanyId(String companyId);

    @Query(value = "select id,company_id,createtime,user_id,name,basesoil_id,u_id,u_name from t_warehouse where basesoil_id=?1", nativeQuery = true)
    List<Warehouse> findByCompanyId2(String baseSoilId);

}
